home *** CD-ROM | disk | FTP | other *** search
- property videoList, currentItem, leftPointer, rightPointer, scrollLeftRegion, scrollRightRegion, timeline, gameButChan, booleanList, hiliteChan, signPathList, signChan, butWidth, tool, toolList, firstHatChan, activeAreaChan, cropMarksChan, hatChan, animList, animChan, gameButBmap, nameSoundList, gameIntroSound
- global gActorList, gHiddenActorList, gMenuObject, gQTViewerObject, gUserObject, gVTLgameObject, gVTLobject, gRollAnimButton, gCustomCursor, gAlbumObject, gCDpath, gHardHatObject, gFileSep, gErrorTrapFlag
-
- on birth me
- set videoList to ["0811.MOV", "0812.MOV", "0813.MOV", "0814.MOV", "0815.MOV", "0816.MOV", "0817.MOV", "0818.MOV", "0819.MOV"]
- set animList to [[21, 2], [16, 2], [12, 4], [19, 3], [11, 2, 1], [20, 2], [14, 3], [15, 2, 1], [27, 2]]
- set booleanList to [0, 0, 0, 0, 0, 0, 0, 0, 0]
- set scrollLeftRegion to 4
- set scrollRightRegion to 5
- set timeline to 2
- set hiliteChan to 45
- set gameButChan to 32
- set gameButBmap to the number of cast "VTLgameButton1"
- set firstHatChan to 15
- set activeAreaChan to 1
- set cropMarksChan to 19
- set animChan to 21
- set currentItem to 1
- set leftPointer to the number of cast "LeftPointer"
- set rightPointer to the number of cast "RightPointer"
- set signPathList to [1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
- set signChan to 13
- set nameSoundList to ["A811N", "A812N", "A813N", "A814N", "A815N", "A816N", "A817N", "A818N", "A819N"]
- set butWidth to 45
- set toolList to [#Tv: [0, the number of cast "VTLtvCursor"], #camera: [0, the number of cast "VTLcamCursor"]]
- set tool to #None
- set gameIntroSound to "RCA819HA"
- return me
- end
-
- on update me
- if objectp(gCustomCursor) and (tool = #camera) then
- if rollOver(activeAreaChan) then
- set the locH of sprite cropMarksChan to the locH of sprite activeAreaChan + 148
- set the locV of sprite cropMarksChan to the locV of sprite activeAreaChan + 100
- else
- set the locH of sprite cropMarksChan to -1000
- end if
- else
- if (rollOver(scrollLeftRegion) and (currentItem > 1)) or (rollOver(timeline) and (the mouseH < the left of sprite hiliteChan)) then
- cursor(200)
- trackMouse(me)
- set the castNum of sprite 48 to leftPointer
- puppetTempo(60)
- else
- if (rollOver(scrollRightRegion) and (currentItem < 9)) or (rollOver(timeline) and (the mouseH > the right of sprite hiliteChan)) then
- cursor(200)
- trackMouse(me)
- set the castNum of sprite 48 to rightPointer
- puppetTempo(60)
- else
- removeSprite(48)
- cursor(-1)
- end if
- end if
- end if
- end
-
- on trackMouse me
- set the locH of sprite 48 to the mouseH
- set the locV of sprite 48 to the mouseV
- end
-
- on setup me
- puppetPalette(0)
- add(gActorList, me)
- set tvButton to birth(script "Rollover Anim Button Class", "activateTool( gVTLObject, #Tv )", 30, 30, 3, "A713VO45", "A713RO45")
- set the soundWait of tvButton to 0
- setAt(getProp(toolList, #Tv), 1, tvButton)
- set cameraButton to birth(script "Rollover Anim Button Class", "activateTool( gVTLObject, #Camera )", 31, 31, 5, "A7VO41", "A7RO41")
- set the soundWait of cameraButton to 0
- setAt(getProp(toolList, #camera), 1, cameraButton)
- repeat with x = 1 to count(toolList)
- set toolData to getAt(toolList, x)
- set toolButObj to getAt(toolData, 1)
- add(gActorList, toolButObj)
- end repeat
- add(gActorList, birth(script "Rollover Anim Button Class", "goMenu( gVTLObject, me )", 27, 27, 5, "RCA-07VO01", "RCA-07RO01"))
- add(gActorList, birth(script "Rollover Anim Button Class", "help( gVTLObject, me )", 28, 28, 11, EMPTY, "RCA-05RO02"))
- add(gActorList, birth(script "Rollover Anim Button Class", "goVTLgame( gVTLgameObject )", gameButChan, gameButChan, 3, "08VO03", "08RO03"))
- puppetSprite(signChan, 1)
- puppetSprite(cropMarksChan, 1)
- puppetSprite(gameButChan, 1)
- puppetSprite(48, 1)
- end
-
- on predraw me
- if the enabled of gVTLgameObject then
- showVTLgameButton(me)
- puppetSprite(gameButChan, 1)
- end if
- end
-
- on showVTLgameButton me
- set the locH of sprite gameButChan to 48
- set the locV of sprite gameButChan to 426
- set the castNum of sprite gameButChan to gameButBmap
- end
-
- on timeLineClick me
- startBuffering()
- if objectp(gCustomCursor) then
- resetTool(me)
- else
- if not objectp(gRollAnimButton) then
- set choice to buttonBarHandler(#Horizontal, 9, butWidth, 0)
- if the mouseH < the left of sprite hiliteChan then
- if choice <> 0 then
- if the enabled of gVTLgameObject = 1 then
- if choice = (currentItem - 1) then
- scrollLeft(me)
- else
- sayNumber(me, choice)
- skipSelection(me, choice)
- end if
- else
- scrollLeft(me)
- end if
- end if
- else
- if the mouseH > the right of sprite hiliteChan then
- if choice <> 0 then
- if the enabled of gVTLgameObject = 1 then
- if choice = (currentItem + 1) then
- scrollRight(me)
- else
- sayNumber(me, choice)
- skipSelection(me, choice)
- end if
- else
- scrollRight(me)
- end if
- end if
- end if
- end if
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end if
- end if
- flushBuffer()
- end
-
- on sayNumber me, whichNumber
- puppetSound(string(whichNumber) & "th")
- end
-
- on skipSelection me, choice
- wasVideoSeen(me)
- predraw(me)
- set currentItem to choice
- moveSign(me, #Up)
- cursor(-1)
- removeSprite(48)
- removeHardHat(me)
- puppetTransition(51, 1)
- go("VTL" & string(choice))
- puppetSound(getAt(nameSoundList, currentItem))
- moveSign(me, #down)
- drawHardHat(me)
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end
-
- on changeHilite me, delta
- set the locH of sprite hiliteChan to the locH of sprite hiliteChan + (delta * butWidth)
- end
-
- on drawHardHat me
- if the howManyHats of gHardHatObject < 100 then
- set hatChan to firstHatChan - 1 + random(3)
- set the locH of sprite hatChan to the locH of sprite hatChan + 1000
- puppetSprite(hatChan, 1)
- puppetTransition(51, 1)
- updateStage()
- end if
- end
-
- on removeHardHat me
- set the locH of sprite hatChan to -1000
- puppetSprite(hatChan, 0)
- end
-
- on globalButtonClick me
- if objectp(gCustomCursor) then
- resetTool(me)
- else
- if objectp(gRollAnimButton) then
- click(gRollAnimButton)
- end if
- end if
- end
-
- on resetTool me
- set toolType to the type of gCustomCursor
- set toolData to getProp(toolList, toolType)
- set toolButtonObject to getAt(toolData, 1)
- resetBitmap(toolButtonObject)
- showAllActors()
- dispose(gCustomCursor)
- set tool to #None
- end
-
- on activateTool me, toolSymbol
- startBuffering()
- set toolData to getProp(toolList, toolSymbol)
- set toolButtonObject to getAt(toolData, 1)
- if objectp(gCustomCursor) then
- resetBitmap(toolButtonObject)
- set tool to #None
- dispose(gCustomCursor)
- showAllActors()
- else
- hideActor(toolButtonObject)
- set toolCursor to getAt(toolData, 2)
- select(toolButtonObject)
- birth(script "ColorCursor Class", toolCursor, toolSymbol)
- add(gActorList, gCustomCursor)
- set tool to toolSymbol
- if tool = #camera then
- clearHiddenActor(me)
- add(gActorList, me)
- end if
- end if
- flushBuffer()
- end
-
- on activeAreaClick me
- startBuffering()
- if tool = #Tv then
- TVhandler(me)
- else
- if tool = #camera then
- cameraHandler(me)
- else
- runVTLanim(me)
- end if
- end if
- flushBuffer()
- end
-
- on runVTLanim me
- set animData to getAt(animList, currentItem)
- set frames to getAt(animData, 1)
- set loops to getAt(animData, 2)
- if count(animData) = 3 then
- set reverseFlag to 1
- end if
- set baseCast to the castNum of sprite animChan
- preLoadCast(baseCast + 1, baseCast + frames - 1)
- repeat with loopCount = 1 to loops
- repeat with offset = 0 to frames - 1
- set the castNum of sprite animChan to baseCast + offset
- updateStage()
- startTimer()
- repeat while the timer < 6
- end repeat
- end repeat
- if reverseFlag then
- repeat with offset = frames - 2 down to 0
- set the castNum of sprite animChan to baseCast + offset
- updateStage()
- startTimer()
- repeat while the timer < 6
- end repeat
- end repeat
- end if
- end repeat
- end
-
- on TVhandler me
- setAt(booleanList, currentItem, 1)
- if getAt(booleanList, 9) = 1 then
- set the enabled of gVTLgameObject to 1
- end if
- set videoName to getAt(videoList, currentItem)
- set the videoName of gQTViewerObject to videoName
- set paletteName to the name of cast (the number of cast videoName - 1)
- set the paletteName of gQTViewerObject to paletteName
- set the returnScript of gQTViewerObject to "returnFromQT( gVTLObject )"
- cursor(-1)
- set tool to #None
- dispose(gCustomCursor)
- removeSprite(48)
- clearAllActors()
- unpuppetAll()
- puppetPalette("VTLpal")
- go("Grass")
- go(the frame + 1)
- puppetPalette(paletteName, 60)
- updateStage()
- puppetPalette(0)
- unLoadCast()
- go("QT" & string(currentItem + 10))
- end
-
- on cameraHandler me
- puppetSound("camerashut2")
- updateStage()
- set toolData to getProp(toolList, #camera)
- set toolButtonObject to getAt(toolData, 1)
- resetBitmap(toolButtonObject)
- set tool to #None
- cursor(-1)
- dispose(gCustomCursor)
- removeSprite(48)
- set the locH of sprite cropMarksChan to -1000
- addPhoto(gAlbumObject, "VTL" & string(currentItem))
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- showAllActors()
- end
-
- on returnFromQT me
- prepareToLeave(gQTViewerObject)
- go("Grass")
- unLoadCast()
- go(the frame + 1)
- puppetPalette("VTLpal", 60)
- updateStage()
- puppetPalette(0)
- predraw(me)
- go("VTL" & string(currentItem))
- go(the frame + 1)
- moveSign(me, #down)
- setup(me)
- drawHardHat(me)
- abort()
- end
-
- on scrollRight me
- if objectp(gCustomCursor) then
- resetTool(me)
- else
- if (currentItem < 9) and not objectp(gRollAnimButton) then
- wasVideoSeen(me)
- set currentItem to currentItem + 1
- sayNumber(me, currentItem)
- go(the frame + 1)
- moveSign(me, #Up)
- removeHardHat(me)
- puppetTransition(51, 1)
- updateStage()
- repeat with x = 1 to 96
- set the locH of sprite 7 to the locH of sprite 7 - 1
- set the locH of sprite 8 to the locH of sprite 8 - 3
- set the locH of sprite 9 to the locH of sprite 9 - 5
- updateStage()
- end repeat
- puppetSound(0)
- cursor(-1)
- removeSprite(48)
- go(label("VTL" & string(currentItem)) + 1)
- puppetSound(getAt(nameSoundList, currentItem))
- moveSign(me, #down)
- if (currentItem = 9) and (the enabled of gVTLgameObject <> 1) then
- set the enabled of gVTLgameObject to 1
- showVTLgameButton(me)
- drawHardHat(me)
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- sound playFile 1, gCDpath & "SOUND" & gFileSep & "HELP" & gFileSep & gameIntroSound
- repeat while soundBusy(1)
- end repeat
- else
- drawHardHat(me)
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end if
- end if
- end if
- end
-
- on moveSign me, direction
- if direction = #Up then
- repeat with delta in signPathList
- set the locV of sprite signChan to the locV of sprite signChan - delta
- moveSprite(me)
- end repeat
- puppetSprite(signChan, 0)
- else
- repeat with delta in signPathList
- set the locV of sprite signChan to the locV of sprite signChan + delta
- moveSprite(me)
- end repeat
- puppetSprite(signChan, 1)
- end if
- end
-
- on moveSprite me
- updateStage()
- startTimer()
- repeat while the timer < 2
- end repeat
- end
-
- on scrollLeft me
- if objectp(gCustomCursor) then
- resetTool(me)
- else
- if (currentItem > 1) and not objectp(gRollAnimButton) then
- wasVideoSeen(me)
- set currentItem to currentItem - 1
- sayNumber(me, currentItem)
- go(the frame - 2)
- moveSign(me, #Up)
- removeHardHat(me)
- puppetTransition(51, 1)
- updateStage()
- repeat with x = 1 to 96
- set the locH of sprite 7 to the locH of sprite 7 + 1
- set the locH of sprite 8 to the locH of sprite 8 + 3
- set the locH of sprite 9 to the locH of sprite 9 + 5
- updateStage()
- end repeat
- puppetSound(0)
- cursor(-1)
- removeSprite(48)
- go(label("VTL" & string(currentItem)) + 1)
- puppetSound(getAt(nameSoundList, currentItem))
- moveSign(me, #down)
- drawHardHat(me)
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end if
- end if
- end
-
- on wasVideoSeen me
- end
-
- on goMenu me, buttonObject
- set tool to #None
- clearAllActors()
- unpuppetAll()
- makeButtonJump(buttonObject)
- puppetPalette("VTLpal")
- go("Grass")
- go(the frame + 1)
- unLoadCast()
- goLocationMap()
- end
-
- on help me, buttonObject
- birth(script "Help Parent", buttonObject, #VTL)
- end
-